<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>高德地图输入提示</title>
    <script src="https://webapi.amap.com/maps?v=2.0&key=YOUR_AMAP_KEY"></script>
    <script src="https://webapi.amap.com/ui/1.0/main.js"></script>
    <style>
        #container {
            width: 50%;
            height: 50%;
        }
    </style>
</head>
<body>
    <div>
        <input id="searchInput" type="text" placeholder="输入地点">
    </div>
    <div id="container"></div>

    <script>
        let map = new AMap.Map('container', {
            resizeEnable: true
        });

        let placeSearch = new AMap.PlaceSearch({
            pageSize: 5,
            pageIndex: 1,
            city: ""
        });

        document.getElementById('searchInput').addEventListener('input', function(e) {
            let keywords = e.target.value;
            if (keywords) {
                placeSearch.search(keywords, function(status, result) {
                    if (status === 'complete' && result.info === 'OK') {
                        // 处理搜索结果
                        let pois = result.poiList.pois;
                        console.log(pois);
                        // 你可以在这里更新你的界面，显示搜索建议
                    }
                });
            }
        });
    </script>
</body>
</html>
